﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DataBase_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        validaCohort();
        SelecionaCohort();
        configuraConteudoTeam();
    }

    private void validaCohort()
    {
        if (Session["cohortAtiva"] == null)
        {
            Response.Redirect("prePage.aspx?redirectUrl=CohortsTeam.aspx");
        }
    }

    private void SelecionaCohort()
    {
        if (Session["cohortAtiva"] != null)
        {
            switch (Session["cohortAtiva"].ToString())
            {
                case "1":
                    teamBrazil.Visible = true;
                    break;
                case "3":
                    teamGuatemala.Visible = true;
                    break;
                case "4":
                    teamIndia.Visible = true;
                    break;
                case "5":
                    teamPhilippines.Visible = true;
                    break;
                case "2":
                    teamAfrica.Visible = true;
                    break;
            }
        }
    }

    private void configuraConteudoTeam()
    {
        teamBrazil.ImageUrl      = "Img/conteudoTeam/team_brazil.jpg";
        teamGuatemala.ImageUrl   = "Img/conteudoTeam/team_guatemala.jpg";
        teamIndia.ImageUrl       = "Img/conteudoTeam/team_india.jpg";
        teamPhilippines.ImageUrl = "Img/conteudoTeam/team_philippines.jpg";
        teamAfrica.ImageUrl      = "Img/conteudoTeam/team_africa.jpg";
    }
}
